package com.zj.service;

import com.zj.web.bean.AddressDTO;
import java.util.List;

public interface AddressService {
    //是否是默认地址
    Integer ADDRESS_ISDEFAULT=1;
    Integer ADDRESS_NOTDEFAULT=0;
    //地址状态 0-不是默认,1-默认
    Integer ADDRESS_STATUS_DISABLE=0;
    Integer ADDRESS_STATUS_ENABLE=1;
    //添加地址
    public AddressDTO addAddress(AddressDTO addressDTO);
    //根据状态和用户Id查找地址
    public List<AddressDTO> getAddressesByStatus(Integer address_status,Long user_id);
    //根据索引和用户Id更新为是否是默认地址
    public boolean updateIsDefault(Long address_id,Integer is_default,Long user_id);
    //根据索引改变地址的状态
    public boolean updateAddressStatus(Long address_id,Integer address_status);

    //根据索引修改地址信息
    public boolean updateAddress(Long address_id,AddressDTO addressDTO);

    //根据用户Id查找默认地址的地址信息
    public AddressDTO getDefaultAddress(Integer is_default,Integer address_status,Long user_id);

}
